







<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so search-form">
            <input class="layui-input"  autocomplete="off" placeholder="开始日" name="date1"  value="{:input('date1')}" id="start">
            <input class="layui-input"  autocomplete="off" placeholder="截止日" name="date2"  value="{:input('date2')}" id="end">
            <input type="text" name="search_data"  placeholder="用户名|商家名|UID" autocomplete="off" value="{:input('search_data')}"  class="layui-input">
            <div class="layui-input-inline">
                <select name="wallet_id">
                    <option value="" >全部币种</option>
                    {volist name='wallet' id='vo'}
                    <option value="{$vo['id']}" {notempty name="param['wallet_id']"}{if condition="$param['wallet_id'] eq $vo['id']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="state">
                    <option value="" >全部状态</option>
                    <option value="0" {if condition=" isset($param['state']) && $param['state'] eq '0' "} selected="selected" {/if}{/notempty} >排队中</option>
                    <option value="1" {notempty name="param['state']"}{if condition="$param['state'] eq 1"} selected="selected" {/if}{/notempty} >未完成</option>
                    <option value="2" {notempty name="param['state']"}{if condition="$param['state'] eq 2"} selected="selected" {/if}{/notempty} >已完成</option>
                    <option value="3" {notempty name="param['state']"}{if condition="$param['state'] eq 3"} selected="selected" {/if}{/notempty} >已取消</option>

                </select>
            </div>
            <div class="layui-input-inline">
                <select name="money">
                    <option value="" >全部</option>
                    {volist name='list.price' id='vo'}
                    <option value="{$vo}" {notempty name="param['money']"}{if condition="$param['money'] eq $vo"} selected="selected" {/if}{/notempty} >{$vo}</option>
                    {/volist}

                </select>
            </div>
            {if condition='$param["type"] eq 2'}
            <div class="layui-input-inline">
                <select name="order">
                    <option value="" >全部</option>
                    <option value="1" {notempty name="param['order']"}{if condition="$param['order'] eq 1"} selected="selected" {/if}{/notempty} >位置正序</option>
                    <option value="2" {notempty name="param['order']"}{if condition="$param['order'] eq 2"} selected="selected" {/if}{/notempty} >位置倒序</option>

                </select>
            </div>
            {/if}
            <input name="type" type="hidden" value="{$param['type']}"/>
            {if condition='$param["type"] eq 1'}
                <button class="layui-btn"  id="search"  url="{:url('trade_list')}"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            {else/}
                 <button class="layui-btn"  id="search"  url="{:url('trade_sell_list')}"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            {/if}

        </form>
    </div>
    <xblock>
        <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
        <ob_link><a  href="{:url('TradeAdd',['type'=>$param['type']])}" style="color: white">   <button class="layui-btn" > {if condition='$param["type"] eq 1'}添加代发订单{else/}添加出售订单{/if}</button></a></ob_link>
        <ob_link> <button class="layui-btn export" url="{:url('exportOtcTradeList')}"> 导 出</button></ob_link>
        <span class="x-right" style="line-height:40px;margin-right:10px;">共有数据：{$list.count} 条</span>

    </xblock>

    <hr/>
    <div class="layui-table x-admin">
            <span>ETH排队中:</span>
            {volist name="list.eths" id="v" key='k'}
            |
            <span>
                {$v.name}金额：{$v.count} 单
            </span>
            {/volist}

    </div>
    <hr/>
    <div class="layui-table x-admin">
        <span>BTC排队中:</span>
        {volist name="list.btcs" id="v" key='k'}
        |
        <span>
                {$v.name}金额：{$v.count} 单
            </span>
        {/volist}

    </div>
    <hr/>
    <div class="layui-table x-admin">
        <span>USDT排队中:</span>
        {volist name="list.usdts" id="v" key='k'}
        |
        <span>
                {$v.name}金额：{$v.count} 单
            </span>
        {/volist}

    </div>
    <hr/>
    <table class="layui-table x-admin">
        <thead>
        <tr>
            <th>
                序号
            </th>
            <th>店铺信息</th>
            <th>订单信息</th>
            <th>其他</th>

            <!--<th>审核人</th>-->
            <th>操作</th>
        </thead>
        {notempty name='list.list'}
        <tbody>
        {volist name='list.list' id='vo' key="k"}
        <tr>
            <td class="">
                {$k}
            </td>
            <td class="col-md-3 ">
                <div><label>用户名:</label><span>{$vo.username}</span>{if condition ="$vo.is_company eq 1"}<span style="color: #f56c6c">(公司账户)</span>{/if}</div>
                <div> <label>手机号码:</label><span>+{$vo.area}{$vo.mobile}</span></div>
                <div>  <label>店铺名称:</label><span>{$vo.shop_name}</span></div>
                <div>  <label>{if condition="$vo.type eq 1"}付款方式{else/}收款方式{/if}:</label><span>{$vo.pay_text}</span></div>
            </td>
            <td class="col-md-3 ">
                <div><label>代发订单金额:</label><span>{$vo.total}</span></div>
                <div> <label>货币类型:</label><span>{$vo.wallet->name}</span></div>
                <div>  <label>货币单价:</label><span>{$vo.price}</span></div>
                <div>  <label>货币数量:</label><span>{$vo.number}</span></div>
                <div>  <label>已交易数量:</label><span>{$vo.number-$vo.surplus_number}</span></div>
                <div>  <label>剩余数量:</label><span>{$vo.surplus_number}</span></div>
                <div>  <label>剩余总价:</label><span>{$vo.surplus_total}</span></div>

            </td>
            <td class="col-md-3 ">
                <div><label>状态:</label><span>{$vo.state_html}</span></div>
                <div> <label>货币类型:</label><span>{$vo.wallet->name}</span></div>
                <div><label>位置:</label><span>{$vo.postition}</span></div>
                <div>  <label>时间:</label><span>{$vo.create_time}</span></div>
                <div>  <label>交易匹配次数:</label><span>{$vo.match_count}</span></div>
                <div>  <label>是否被申诉过的订单:</label><span>{if condition ="$vo.is_complaint eq 1"}是{else/}否{/if}</span></div>
                {if condition="$vo.type eq 2"}  <div><label>是否推荐:</label><span> {if condition="$vo['is_recommend'] eq 1"}
                <ob_link><a class="ajax-get" href="{:url('trade_check', array('ids' => $vo['id'], 'is_recommend' =>0))}">  <span class='badge bg-green'>是</span></a></ob_link>

                {else/}
                <ob_link><a class="ajax-get" href="{:url('trade_check', array('ids' => $vo['id'], 'is_recommend' => 1))}">  <span class='badge bg-red'>否</span></a></ob_link>

                {/if}</span></div>{/if}
            </td>

            <td class="td-manage ">



                {if condition="$vo['state'] eq 1 || $vo['state'] eq 0 "}
                  <ob_link><a title="查看详情" style="color: #0a8cd2"  href="{:url('trade_detail', array('id' => $vo['id']))}" >
                         查看详情
                    </a></ob_link>
                    <ob_link><a title="取消" class="ajax-get" style="color: #0a8cd2"  href="{:url('trade_check', array('id' => $vo['id'],'state'=>3))}" >
                        取消
                    </a></ob_link>
                {else/}
                    <ob_link><a title="查看详情" style="color: #0a8cd2"  href="{:url('trade_detail', array('id' => $vo['id']))}" >
                        查看详情
                    </a></ob_link>
                {/if}

            </td>
        </tr>
        {/volist}
        {else/}
        <tbody><tr class="odd"><td colspan="12" class="" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
        {/notempty}

        </tbody>
    </table>
    <div class="page">
        {notempty name='list.list'}   {$list.list->render()}{/notempty}
    </div>

</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        layer=layui.layer;
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });








    //导出功能
    $(".export").click(function(){

        window.location.href = searchFormUrl($(".export"));
    });
</script>

</body>

</html>




